﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.IO;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.Text.RegularExpressions;

/**
 *
 * @author eladh, alaah
 */

namespace Windows_System_Snapshot
{
    class Logic : LogicAbstract
    {
        //
        //-------------------------------------------------------------------------------------------
        //
        /// <summary>
        /// implementation for the abstract function. displays a message in a new window or in the console.
        /// </summary>
        /// <param name="content"></param>
        /// <param name="title"></param>
        override public void showMsg(String content, String title)
        {
            if (Program.IS_RUNNING_WITH_GUI)
            {
                ShowMessage.Show(title,content);
            }
            else
            {
                Console.WriteLine("\n" + title + ":\n" + content);
            }
        }
        //
        //-------------------------------------------------------------------------------------------
        //
        /// <summary>
        /// if we are in Console mode, print the running command
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        protected override String runCommand(String command, string arguments)
        {
            if (Program.IS_RUNNING_WITH_GUI == false)
            {
                showMsg(command + " " + arguments, "Pocessing");
            }
            return base.runCommand(command, arguments);
        }
        //
        //-------------------------------------------------------------------------------------------
        //
    }
}
